import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpWxappConfig {
  id!: number;
  appid!: string;
  appsecret!: string;
  uniacid!: number;
  isWxpay: boolean = false;
  wxpayId?: number;
}

export const ImsYzdKpWxappConfigSchema = new EntitySchema({
  class: ImsYzdKpWxappConfig,
  properties: {
    id: { primary: true, type: 'number' },
    appid: { type: 'string', length: 255 },
    appsecret: { type: 'string', length: 255 },
    uniacid: { type: 'number', index: 'uniacid' },
    isWxpay: { type: 'boolean', default: false },
    wxpayId: { type: 'number', nullable: true },
  },
});
